<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'emp_list2.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet" type="text/css" href="css/table.css">

</head>
<body>
	<form action="wageAction!searchEmployee.action" method="post"
		name="search">
		<table cellpadding="0" cellspacing="0" id="mytable">
			<caption>按条件查询</caption>
			<tr>
				<td>部门<select name="employee.emp_dept_id" id="province"
					onChange="Change_Select()">
						<!--第一个下拉菜单-->
						<option value="0">请选择</option>
						<s:iterator value="deptList" var="dept">
							<option value="<s:property value='#dept.dept_id'/>">
								<s:property value="#dept.dept_name" />
							</option>
						</s:iterator>
				</select></td>
				<td>职位<select name="employee.emp_job_id" id="city">
						<!--第二个下拉菜单-->
						<option value="0">请选择</option>
				</select></td>

				<td>员工编号<input name="employee.emp_num" type="text" />
				</td>
				<td>员工姓名<input name="employee.emp_name" type="text" />
				</td>


				<td colspan="2" align="center"><input type="submit" value="提交">
				</td>
		</table>
	</form>
	<table>
		<caption>所有员工</caption>
		<thead>
			<tr>
				<th width="10%">编号</th>
				<th>姓名</th>
				<th>性别</th>
				<th>生日</th>
				<th>学历</th>
				<th>部门</th>
				<th>职务</th>
				<th>电话</th>
				<th>住址</th>
				<th>状态</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody id="tab">

			<s:iterator value="employeeList" var="employee">
				<tr>
					<td><s:property value="#employee.emp_num" /></td>
					<td><s:property value="#employee.emp_name" /></td>
					<td><s:property value="#employee.emp_sex" /></td>
					<td><s:property value="#employee.emp_birth" /></td>
					<td><s:property value="#employee.emp_edu" /></td>
					<td><s:property value="#employee.emp_dept_id" /></td>
					<td><s:property value="#employee.emp_job_id" /></td>
					<td><s:property value="#employee.emp_tel" /></td>
					<td><s:property value="#employee.emp_address" /></td>
					<td><s:property value="#employee.emp_status" /></td>
					<td><a
						href="employeeAction!delEmployee.action?employee.emp_id=<s:property value="#employee.emp_id" />">[删除]</a>
						<a
						href="employeeAction!showUpdateEmployee.action?employee.emp_id=<s:property value="#employee.emp_id" />">[修改]</a>
						<a
						href="wageAction!showAddWage.action?employee.emp_id=<s:property value="#employee.emp_id" />">添加工资信息</a>
						<a
						href="performanceAction!showAddPerformance.action?employee.emp_id=<s:property value="#employee.emp_id" />">添加工作表现</a>
					</td>
				</tr>
			</s:iterator>
		</tbody>
		<tfoot>
			<tr>
				<td colspan="11">
					<form method="post"
						action="employeeAction!listemployeeAction!listEmployee.action">
						<div class="grayr">
							<span class="disabled"> </span>共
							<s:property value="psu.recordCount" />
							条记录，共
							<s:property value="psu.totalPages" />
							页
							<c:if test="${psu.curPage-1>0}">
								<a
									href="employeeAction!listemployeeAction!listEmployee.action?toPage=${psu.curPage-1}">上一页</a>
							</c:if>
							<span class="current"> 当前页：<s:property value="psu.curPage" />
							</span>
							<c:if test="${psu.curPage+1<psu.totalPages}">
								<a
								href="employeeAction!listemployeeAction!listEmployee.action?toPage=${psu.curPage+1}">下一页</a>
							</c:if>
						</div>
					</form></td>
			</tr>
		</tfoot>
	</table>
	<script type="text/javascript">
	<!--
		var Ptr = document.getElementById("tab").getElementsByTagName("tr");
		function $() {
			for (i = 1; i < Ptr.length + 1; i++) {
				Ptr[i - 1].style.backgroundColor = (i % 2 > 0) ? "#fff"
						: "#eee";
			}
		}
		window.onload = $;
		for ( var i = 0; i < Ptr.length; i++) {
			Ptr[i].onmouseover = function() {
				this.tmpClass = this.className;
				this.style.backgroundColor = "#ccc";

			};
			Ptr[i].onmouseout = function() {
				for (i = 1; i < Ptr.length + 1; i++) {
					Ptr[i - 1].style.backgroundColor = (i % 2 > 0) ? "#eee"
							: "#fff";
				}
			}
		}
	//-->
	</script>
</body>
</html>